#include <cstdio>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;

queue<int> q;
vector<int> ans;

int main() {
	int n, np, k, p;
	scanf("%d %d %d", &n, &k, &p);
	for (int i = 1; i <= k; ++i) {
		q.push(i);
	}
	np = 1;
	while (q.size()) {
		if (np == n) {
			ans.push_back(q.front());
			q.pop();
			np = 1;
		} else {
			q.pop();
			++np;
		}
		for (int i = 1; i <= p; ++i) {
			q.push(q.front());
			q.pop();
		}
		
		
	}
	sort(ans.begin(), ans.end());
	for (int i = 0; i < ans.size(); ++i) printf("%d\n", ans[i]);
	return 0;
}
